package com.zbf.多线程;

/**
 * @author: LI-CI-GAO
 * 作者: licigao
 * 日期: 2021/8/16  11:18
 * 描述:
 */
public class TestRunable1 implements Runnable {

    private int next;

    public TestRunable1(int next) {
        this.next = next;
    }

    @Override
    public void run() {

        synchronized ("888"){
            for (int i= 0;i<10;i++){
                System.out.println("=="+next+"=="+i);
            }
        }

        //test();

        TestRunable1.test02(next);

    }

    public synchronized void test(){
        for (int i= 0;i<10;i++){
            System.out.println("=="+next+"=="+i);
        }
    }


    public static synchronized void test02(int next){
        for (int i= 0;i<10;i++){
            System.out.println("=="+next+"=="+i);
        }
    }


}
